import { useState,useEffect } from 'react'

const Son = () => {
    const [value,setValue] = useState("123")
    //销毁的生命周期
    useEffect(function () {
        return function () {
            console.log('该组件被销毁了')
        }
    })
    return <>
        <p>
            {value}
        </p>
        <button onClick={()=>setValue()}>
            销毁
        </button>
    </>
}
export default Son;


